-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update configure_multi_stage_inputs.jl #666
Conversation
1743739
to
de926b1
Compare
1d9a0e9
to
d9638c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
inv_costs_yr::Array, | ||
crp::Array, | ||
tech_wacc::Array) | ||
|
||
# Check for resources with non-zero investment costs and a Capital_Recovery_Period value of 0 years | ||
if any((crp .== 0) .& (inv_costs_yr .> 0)) | ||
msg = "You have some resources with non-zero investment costs and a Capital_Recovery_Period value of 0 years. " * | ||
"These resources will have a calculated overnight capital cost of \$0. Correct your inputs if this is a mistake." | ||
error(msg) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
inv_costs_yr::Array, | |
crp::Array, | |
tech_wacc::Array) | |
# Check for resources with non-zero investment costs and a Capital_Recovery_Period value of 0 years | |
if any((crp .== 0) .& (inv_costs_yr .> 0)) | |
msg = "You have some resources with non-zero investment costs and a Capital_Recovery_Period value of 0 years. " * | |
"These resources will have a calculated overnight capital cost of \$0. Correct your inputs if this is a mistake." | |
error(msg) | |
end | |
inv_costs_yr::Array, | |
crp::Array, | |
tech_wacc::Array) | |
# Check for resources with non-zero investment costs and a Capital_Recovery_Period value of 0 years | |
if any((crp .== 0) .& (inv_costs_yr .> 0)) | |
msg = "You have some resources with non-zero investment costs and a Capital_Recovery_Period value of 0 years. " * | |
"These resources will have a calculated overnight capital cost of \$0. Correct your inputs if this is a mistake." | |
error(msg) | |
end |
cur_stage = settings_d["CurStage"] # Current model | ||
num_stages = settings_d["NumStages"] # Total number of model stages | ||
stage_lens = settings_d["StageLengths"] | ||
|
||
# 1) For each resource, find the minimum of the capital recovery period and the end of the model horizon | ||
# Total time between the end of the final model stage and the start of the current stage | ||
model_yrs_remaining = sum(stage_lens[cur_stage:end]) | ||
model_yrs_remaining = sum(stage_lens[cur_stage:end]; init=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
model_yrs_remaining = sum(stage_lens[cur_stage:end]; init=0) | |
model_yrs_remaining = sum(stage_lens[cur_stage:end]; init = 0) |
occ[i] = sum(inv_costs_yr[i] / (1 + tech_wacc[i]) .^ (p) | ||
for p in 1:payment_yrs_remaining[i]) | ||
for p in 1:payment_yrs_remaining[i]; init=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
occ[i] = sum(inv_costs_yr[i] / (1 + tech_wacc[i]) .^ (p) | |
for p in 1:payment_yrs_remaining[i]) | |
for p in 1:payment_yrs_remaining[i]; init=0) | |
occ[i] = sum( | |
inv_costs_yr[i] / (1 + tech_wacc[i]) .^ (p) | |
for p in 1:payment_yrs_remaining[i]; | |
init = 0) |
2981978
to
6c2669d
Compare
occ[i] = sum(inv_costs_yr[i] / (1 + tech_wacc[i]) .^ (p) | ||
for p in 1:payment_yrs_remaining[i]) | ||
for p in 1:payment_yrs_remaining[i]; init = 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
occ[i] = sum(inv_costs_yr[i] / (1 + tech_wacc[i]) .^ (p) | |
for p in 1:payment_yrs_remaining[i]) | |
for p in 1:payment_yrs_remaining[i]; init = 0) | |
occ[i] = sum( | |
inv_costs_yr[i] / (1 + tech_wacc[i]) .^ (p) | |
for p in 1:payment_yrs_remaining[i]; | |
init = 0) |
inv_costs_yr[i] / (1 + tech_wacc[i]) .^ (p) | ||
for p in 1:payment_yrs_remaining[i]; | ||
init = 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
inv_costs_yr[i] / (1 + tech_wacc[i]) .^ (p) | |
for p in 1:payment_yrs_remaining[i]; | |
init = 0) | |
inv_costs_yr[i] / (1 + tech_wacc[i]) .^ (p) | |
for p in 1:payment_yrs_remaining[i]; | |
init = 0) |
6400edb
to
939080b
Compare
Add check on capital recovery period with non-zero investment cost
With introduction of init = 0 in summation terms to fix for bug encountered when summing over an empty array
Description
What type of PR is this? (check all applicable)
Related Tickets & Documents
Checklist
How this can be tested
Post-approval checklist for GenX core developers
After the PR is approved